<template>
    <div class="app-container">

        <el-tabs v-model="activeName" v-loading="loading" v-if="showCard">
            <el-tab-pane label="花纸生产记录" name="first">
                <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
                    label-width="68px">
                    <!-- <el-form-item label="完成时间">
                        <el-date-picker v-model="queryParams.completionTime2" style="width: 150px;" type="date"
                            placeholder="选择日期"></el-date-picker>
                    </el-form-item> -->

                    <el-form-item label="任务单号">
                        <el-input v-model="queryParams.taskNo" placeholder="请输入生产任务单号"></el-input>
                    </el-form-item>
                    <el-form-item label="完成时间">
                        <el-date-picker type="daterange" v-model="queryParams.taskDate" range-separator="至"
                            start-placeholder="开始日期" end-placeholder="结束日期" clearable style="width: 240px" />
                    </el-form-item>
                    <el-form-item label="产品名称">
                        <el-input v-model="queryParams.productName" placeholder="请输入产品名称"></el-input>
                    </el-form-item>
                    <el-form-item label="合同号">
                        <el-input v-model="queryParams.contractNo" placeholder="请输入合同号"></el-input>
                    </el-form-item>
                    <el-form-item label="产品代号">
                        <el-input v-model="queryParams.productCode" placeholder="请输入产品代码"></el-input>
                    </el-form-item>
                    <!-- <el-form-item label="入库仓库">
                        <el-select v-model="queryParams.warehouse" placeholder="请选择入库仓库">
                            <el-option label="全部" value=""></el-option>
                            <el-option label="仓库1" value="1"></el-option>
                            <el-option label="仓库2" value="2"></el-option>
                        </el-select>
                    -->

                    <el-form-item>
                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
                        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
                    </el-form-item>

                </el-form>
                <el-row :gutter="10" class="mb8">
                    <el-col :span="1.5">
                        <el-button type="primary" plain icon="el-icon-plus" size="mini"
                            @click="handleAddPurchase">新增</el-button>
                    </el-col>
                    <el-col el-col :span="1.5">
                        <el-button type="warning" plain icon="el-icon-download" size="mini"
                            @click="handleExportPurchase">导出</el-button>
                    </el-col>
                    <el-col :span="1.5">
                        <el-upload action="#" :auto-upload="false" :before-upload="beforeExcelUpload"
                            :on-change="handleFileChange" :show-file-list="false" accept=".xlsx, .xls">
                            <el-button type="warning" plain icon="el-icon-right" size="mini">
                                导入
                            </el-button>
                        </el-upload>
                    </el-col>
                    <!-- <el-col el-col :span="1.5">
                        <el-button type="warning" plain icon="el-icon-right" size="mini"
                            @click="handleExportPurchase1">导入</el-button>
                    </el-col> -->
                </el-row>

                <!-- <div slot="content">点击任意一行列即可查看花纸生产记录信息</div> -->
                <el-table :data="PurchaseDate" @row-click="handleRowClick">
                    <el-table-column align="center" label="基本信息">
                        <el-table-column prop="taskNo" align="center" label="生产任务单号" />
                        <el-table-column prop="contractNo" align="center" label="合同号" />
                        <el-table-column prop="productCode" align="center" label="产品代号" />
                        <el-table-column prop="productName" align="center" label="产品名称" />
                        <el-table-column prop="mold" align="center" label="模具编号" />
                        <el-table-column prop="color" align="center" label="花色" />
                    </el-table-column>
                    <el-table-column align="center" label="夹花">
                        <el-table-column prop="workerNo1" align="center" label="工号" />
                        <el-table-column prop="name1" align="center" label="姓名" />
                        <el-table-column prop="unitPrice1" align="center" label="单价" />
                        <el-table-column prop="rejectNumber1" align="center" label="次品数量" />
                        <el-table-column prop="completedNumber1" align="center" label="完成数量" />
                        <el-table-column prop="completionTime1" align="center" label="完成时间" />
                    </el-table-column>
                    <el-table-column align="center" label="刷花">
                        <el-table-column prop="workerNo2" align="center" label="工号" />
                        <el-table-column prop="name2" align="center" label="姓名" />
                        <el-table-column prop="unitPrice2" align="center" label="单价" />
                        <el-table-column prop="rejectNumber2" align="center" label="次品数量" />
                        <el-table-column prop="completedNumber2" align="center" label="完成数量" />
                        <el-table-column prop="completionTime2" align="center" label="完成时间" />
                    </el-table-column>
                    <el-table-column align="center" label="订花">
                        <el-table-column prop="workerNo3" align="center" label="工号" />
                        <el-table-column prop="name3" align="center" label="姓名" />
                        <el-table-column prop="unitPrice3" align="center" label="单价" />
                        <el-table-column prop="rejectNumber3" align="center" label="次品数量" />
                        <el-table-column prop="completedNumber3" align="center" label="完成数量" />
                        <el-table-column prop="completionTime3" align="center" label="完成时间" />
                    </el-table-column>
                    <el-table-column align="center" label="冲花">
                        <el-table-column prop="workerNo4" align="center" label="工号" />
                        <el-table-column prop="name4" align="center" label="姓名" />
                        <el-table-column prop="unitPrice4" align="center" label="单价" />
                        <el-table-column prop="rejectNumber4" align="center" label="次品数量" />
                        <el-table-column prop="completedNumber4" align="center" label="完成数量" />
                        <el-table-column prop="completionTime4" align="center" label="完成时间" />
                    </el-table-column>
                    <el-table-column align="center" label="贴花">
                        <el-table-column prop="workerNo5" align="center" label="工号" />
                        <el-table-column prop="name5" align="center" label="姓名" />
                        <el-table-column prop="unitPrice5" align="center" label="单价" />
                        <el-table-column prop="rejectNumber5" align="center" label="次品数量" />
                        <el-table-column prop="completedNumber5" align="center" label="完成数量" />
                        <el-table-column prop="completionTime5" align="center" label="完成时间" />
                    </el-table-column>
                    <el-table-column label="操作" align="center" fixed="right" width="150px">
                        <template slot-scope="scope">
                            <el-button type="text" size="mini" icon="el-icon-edit"
                                @click="handleUpdatePurchase(scope.row)">修改</el-button>
                            <el-button type="text" size="mini" icon="el-icon-delete"
                                @click="handleDeletePurchase(scope.row)">删除</el-button>
                        </template>
                    </el-table-column>


                </el-table>


                <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
                    :total="total" />






            </el-tab-pane>
            <el-tab-pane label="成型生产记录" name="second">
                <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
                    label-width="68px">


                    <!-- <el-form-item label="生产任务单">
                        <el-date-picker v-model="queryParams.date" style="width: 150px;" type="date"
                            placeholder="选择日期"></el-date-picker>
                    </el-form-item> -->
                    <el-form-item label="任务单号">
                        <!-- <el-select v-model="queryParams.taskNo" placeholder="请选择生产任务单号">
                            <el-option label="人民币" value="1"></el-option>
                            <el-option label="美元" value="2"></el-option>
                        </el-select> -->
                        <el-input v-model="queryParams.taskNo" placeholder="请输入生产任务单号"></el-input>
                    </el-form-item>
                    <el-form-item label="完成时间">
                        <el-date-picker type="daterange" v-model="queryParams.taskDate" range-separator="至"
                            start-placeholder="开始日期" end-placeholder="结束日期" clearable style="width: 240px" />
                    </el-form-item>
                    <el-form-item label="产品名称">
                        <el-input v-model="queryParams.productName" placeholder="请输入产品名称"></el-input>
                    </el-form-item>
                    <el-form-item label="合同号">
                        <el-input v-model="queryParams.contractNo" placeholder="请输入合同号"></el-input>
                    </el-form-item>
                    <el-form-item label="产品代号">
                        <el-input v-model="queryParams.productCode" placeholder="请输入产品代号"></el-input>
                        <!-- <el-select v-model="queryParams.currency" placeholder="请选择币种">
                            <el-option label="人民币" value="1"></el-option>
                            <el-option label="美元" value="2"></el-option>
                        </el-select> -->
                    </el-form-item>


                    <el-form-item>
                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
                        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
                    </el-form-item>

                </el-form>

                <el-row :gutter="10" class="mb8">
                    <el-col :span="1.5">
                        <el-button type="primary" plain icon="el-icon-plus" size="mini"
                            @click="handleAddProduction">新增</el-button>
                    </el-col>
                    <el-col el-col :span="1.5">
                        <el-button type="warning" plain icon="el-icon-download" size="mini"
                            @click="handleExportPurchase">导出</el-button>
                    </el-col>
                    <el-col :span="1.5">
                        <el-upload action="#" :auto-upload="false" :before-upload="beforeExcelUpload"
                            :on-change="handleFileChange" :show-file-list="false" accept=".xlsx, .xls">
                            <el-button type="warning" plain icon="el-icon-right" size="mini">
                                导入
                            </el-button>
                        </el-upload>
                    </el-col>
                </el-row>

                <!-- <div slot="content">点击任意一行列即可查看花纸生产记录信息</div> -->
                <el-table :data="ProductionDate" @row-click="handleRowClick">
                    <el-table-column align="center" label="基本信息">
                        <el-table-column prop="taskNo" align="center" label="生产任务单号" />
                        <el-table-column prop="contractNo" align="center" label="合同号" />
                        <el-table-column prop="productCode" align="center" label="产品代号" />
                        <el-table-column prop="productName" align="center" label="产品名称" />
                        <el-table-column prop="mold" align="center" label="模具编号" />
                        <el-table-column prop="color" align="center" label="花色" />
                    </el-table-column>
                    <el-table-column align="center" label="成型">
                        <el-table-column prop="workerNo" align="center" label="工号" />
                        <el-table-column prop="name" align="center" label="姓名" />
                        <el-table-column prop="classes" align="center" label="班次" />
                        <el-table-column prop="machine" align="center" label="机台" />
                        <el-table-column prop="unitPrice" align="center" label="单价" />
                        <el-table-column prop="completedNumber" align="center" label="成品数量" />
                        <el-table-column prop="rejectNumber" align="center" label="次品数量" />
                        <el-table-column prop="wasteNumber" align="center" label="废品数量" />
                        <el-table-column prop="flashNumber" align="center" label="毛边数量" />
                        <el-table-column prop="strikeNumber" align="center" label="敲缺数量" />
                        <el-table-column prop="rank" align="center" label="等级" />
                        <el-table-column prop="QT" align="center" label="质检员" />
                        <el-table-column prop="completionTime" align="center" label="完成时间" />
                    </el-table-column>

                    <el-table-column label="操作" align="center" fixed="right" width="150px">
                        <template slot-scope="scope">
                            <el-button type="text" size="mini" icon="el-icon-edit"
                                @click="handleUpdateProduction(scope.row)">修改</el-button>
                            <el-button type="text" size="mini" icon="el-icon-delete"
                                @click="handleDeleteProduction(scope.row)">删除</el-button>
                        </template>
                    </el-table-column>






                </el-table>



                <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
                    :total="total" />



            </el-tab-pane>
            <!--研磨生产记录单-->
            <el-tab-pane label="研磨生产记录" name="third">
                <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
                    label-width="68px">
                    <!-- <el-form-item label="完成时间">
                        <el-date-picker v-model="queryParams.completionTime2" style="width: 150px;" type="date"
                            placeholder="选择日期"></el-date-picker>
                    </el-form-item> -->

                    <el-form-item label="任务单号">
                        <el-input v-model="queryParams.taskNo" placeholder="请输入生产任务单号"></el-input>
                    </el-form-item>
                    <el-form-item label="完成时间">
                        <el-date-picker type="daterange" v-model="queryParams.taskDate" range-separator="至"
                            start-placeholder="开始日期" end-placeholder="结束日期" clearable style="width: 240px" />
                    </el-form-item>
                    <el-form-item label="产品名称">
                        <el-input v-model="queryParams.productName" placeholder="请输入产品名称"></el-input>
                    </el-form-item>
                    <el-form-item label="合同号">
                        <el-input v-model="queryParams.contractNo" placeholder="请输入合同号"></el-input>
                    </el-form-item>
                    <el-form-item label="产品代号">
                        <el-input v-model="queryParams.productCode" placeholder="请输入产品代码"></el-input>
                    </el-form-item>
                    <!-- <el-form-item label="入库仓库">
                        <el-select v-model="queryParams.warehouse" placeholder="请选择入库仓库">
                            <el-option label="全部" value=""></el-option>
                            <el-option label="仓库1" value="1"></el-option>
                            <el-option label="仓库2" value="2"></el-option>
                        </el-select>
                    -->

                    <el-form-item>
                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
                        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
                    </el-form-item>

                </el-form>
                <el-row :gutter="10" class="mb8">
                    <el-col :span="1.5">
                        <el-button type="primary" plain icon="el-icon-plus" size="mini"
                            @click="handleAdd">新增</el-button>
                    </el-col>
                    <el-col el-col :span="1.5">
                        <el-button type="warning" plain icon="el-icon-download" size="mini"
                            @click="handleExportPurchase">导出</el-button>
                    </el-col>
                    <el-col :span="1.5">
                        <el-upload action="#" :auto-upload="false" :before-upload="beforeExcelUpload"
                            :on-change="handleFileChange" :show-file-list="false" accept=".xlsx, .xls">
                            <el-button type="warning" plain icon="el-icon-right" size="mini">
                                导入
                            </el-button>
                        </el-upload>
                    </el-col>
                    <!-- <el-col el-col :span="1.5">
                        <el-button type="warning" plain icon="el-icon-right" size="mini"
                            @click="handleExportPurchase1">导入</el-button>
                    </el-col> -->
                </el-row>

                <el-table :data="detailedData" v-loading="loading" @selection-change="handleSelectionChange">
                    <el-table-column align="center" label="基本信息">
                        <el-table-column prop="taskNo" align="center" label="生产任务单号" />
                        <el-table-column prop="contractNo" align="center" label="合同号" />
                        <el-table-column prop="productCode" align="center" label="产品代号" />
                        <el-table-column prop="productName" align="center" label="产品名称" />
                        <el-table-column prop="mold" align="center" label="模具编号" />
                        <el-table-column prop="color" align="center" label="花色" />
                    </el-table-column>
                    <el-table-column align="center" label="磨边">
                        <el-table-column prop="workerNo1" align="center" label="工号" />
                        <el-table-column prop="name1" align="center" label="姓名" />
                        <el-table-column prop="unitPrice1" align="center" label="单价" />
                        <el-table-column prop="rejectNumber1" align="center" label="次品数量" />
                        <el-table-column prop="completedNumber1" align="center" label="完成数量" />
                        <el-table-column prop="completionTime1" align="center" label="完成时间" />
                    </el-table-column>
                    <el-table-column align="center" label="磨孔">
                        <el-table-column prop="workerNo2" align="center" label="工号" />
                        <el-table-column prop="name2" align="center" label="姓名" />
                        <el-table-column prop="unitPrice2" align="center" label="单价" />
                        <el-table-column prop="rejectNumber2" align="center" label="次品数量" />
                        <el-table-column prop="completedNumber2" align="center" label="完成数量" />
                        <el-table-column prop="completionTime2" align="center" label="完成时间" />
                    </el-table-column>
                    <el-table-column align="center" label="抛光">
                        <el-table-column prop="workerNo3" align="center" label="工号" />
                        <el-table-column prop="name3" align="center" label="姓名" />
                        <el-table-column prop="unitPrice3" align="center" label="单价" />
                        <el-table-column prop="rejectNumber3" align="center" label="次品数量" />
                        <el-table-column prop="completedNumber3" align="center" label="完成数量" />
                        <el-table-column prop="completionTime3" align="center" label="完成时间" />
                    </el-table-column>
                    <el-table-column prop="QTSecond" align="center" label="二级质检员" />

                    <el-table-column label="操作" align="center" width="150px" fixed="right">
                        <template slot-scope="scope">
                            <el-button size="mini" type="text" icon="el-icon-edit"
                                @click="handleUpdate(scope.row)">修改</el-button>
                            <el-button size="mini" type="text" icon="el-icon-delete"
                                @click="handleDelete(scope.row)">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>


                <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
                    :total="total" />



            </el-tab-pane>

            <el-tab-pane label="包装生产记录" name="four">
                <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
                    label-width="68px">


                    <!-- <el-form-item label="生产任务单">
                        <el-date-picker v-model="queryParams.date" style="width: 150px;" type="date"
                            placeholder="选择日期"></el-date-picker>
                    </el-form-item> -->
                    <el-form-item label="任务单号">
                        <!-- <el-select v-model="queryParams.taskNo" placeholder="请选择生产任务单号">
                            <el-option label="人民币" value="1"></el-option>
                            <el-option label="美元" value="2"></el-option>
                        </el-select> -->
                        <el-input v-model="queryParams.taskNo" placeholder="请输入生产任务单号"></el-input>
                    </el-form-item>
                    <el-form-item label="完成时间">
                        <el-date-picker type="daterange" v-model="queryParams.taskDate" range-separator="至"
                            start-placeholder="开始日期" end-placeholder="结束日期" clearable style="width: 240px" />
                    </el-form-item>
                    <el-form-item label="产品名称">
                        <el-input v-model="queryParams.productName" placeholder="请输入产品名称"></el-input>
                    </el-form-item>
                    <el-form-item label="合同号">
                        <el-input v-model="queryParams.contractNo" placeholder="请输入合同号"></el-input>
                    </el-form-item>
                    <el-form-item label="产品代号">
                        <el-input v-model="queryParams.productCode" placeholder="请输入产品代号"></el-input>
                        <!-- <el-select v-model="queryParams.currency" placeholder="请选择币种">
                            <el-option label="人民币" value="1"></el-option>
                            <el-option label="美元" value="2"></el-option>
                        </el-select> -->
                    </el-form-item>


                    <el-form-item>
                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
                        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
                    </el-form-item>

                </el-form>

                <el-row :gutter="10" class="mb8">
                    <el-col :span="1.5">
                        <el-button type="primary" plain icon="el-icon-plus" size="mini"
                            @click="handleAddComm">新增</el-button>
                    </el-col>
                    <el-col el-col :span="1.5">
                        <el-button type="warning" plain icon="el-icon-download" size="mini"
                            @click="handleExportPurchase">导出</el-button>
                    </el-col>
                    <el-col :span="1.5">
                        <el-upload action="#" :auto-upload="false" :before-upload="beforeExcelUpload"
                            :on-change="handleFileChange" :show-file-list="false" accept=".xlsx, .xls">
                            <el-button type="warning" plain icon="el-icon-right" size="mini">
                                导入
                            </el-button>
                        </el-upload>
                    </el-col>
                </el-row>
                <!-- <el-tooltip placement="top"> -->
                <el-table :data="commdate" v-loading="loading" @row-click="showTab">
                    <el-table-column align="center" label="基本信息">
                        <el-table-column prop="taskNo" align="center" label="生产任务单号" />
                        <el-table-column prop="contractNo" align="center" label="合同号" />
                        <el-table-column prop="productCode" align="center" label="产品代号" />
                        <el-table-column prop="productName" align="center" label="产品名称" />
                        <el-table-column prop="mold" align="center" label="模具编号" />
                        <el-table-column prop="color" align="center" label="花色" />
                    </el-table-column>
                    <el-table-column align="center" label="包装">
                        <el-table-column align="center" label="工号" prop="workNo" />
                        <el-table-column align="center" label="姓名" prop="name" />
                        <el-table-column align="center" label="单价" prop="unitPrice" />
                        <el-table-column align="center" prop="completedNumber" label="完成数量" />
                        <el-table-column align="center" prop="completionTime" label="完成时间" />
                    </el-table-column>

                    <el-table-column label="操作" fixed="right" align="center" width="150px">
                        <template slot-scope="scope">
                            <el-button type="text" size="mini" icon="el-icon-edit"
                                @click="handleUpdateComm(scope.row)">修改</el-button>
                            <el-button type="text" size="mini" icon="el-icon-delete"
                                @click="handleDeleteComm(scope.row)">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>



                <pagination :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"
                    :total="total" />



            </el-tab-pane>








        </el-tabs>



        <!-- 花纸生产记录 -->
        <el-dialog :title="titlePurchase" :visible.sync="openPurchase" width="800px" append-to-body>
            <el-form :model="formPurchase" ref="formPurchase" :rules="rulesPurchase" label-width="80px">
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="合同号" prop="contractNo">
                            <el-select v-model="formPurchase.contractNo" placeholder="请选择生产任务单号">
                                <el-option label="PD-HZ92-27-NIO-NI" value="PD-HZ92-27-NIO-NI"></el-option>
                                <el-option label="PD-HZ92-31-NIO-NI" value="PD-HZ92-31-NIO-NI"></el-option>
                                <el-option label="PD-HZ72-33-NIO-NI" value="PD-HZ72-33-NIO-NI"></el-option>
                            </el-select>
                            <!-- <el-input v-model="formPurchase.contractNo" placeholder="请输入合同号"></el-input> -->
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="产品代号" prop="productCode">
                            <!-- <el-input v-model="formPurchase.name" placeholder="请输入产品代号"></el-input> -->
                            <el-select v-model="formPurchase.productCode" placeholder="请选择产品代号">
                                <el-option label="HZ998-No-9876" value="HZ998-No-9876"></el-option>
                                <el-option label="HZ998-No-1987" value="HZ998-No-1987"></el-option>
                                <el-option label="HZ998-No-1989" value="HZ998-No-1989"></el-option>
                            </el-select>
                            <!-- <el-input v-model="formPurchase.name" placeholder="请输入产品代号"></el-input> -->
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="产品名称" prop="productName">
                            <el-input v-model="formPurchase.productName" placeholder="请输入产品名称"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row>

                    <el-col :span="8">
                        <el-form-item label="模具编号" prop="mold">
                            <!-- <el-input v-model="formPurchase.mold" placeholder="请输入模具编号"></el-input> -->
                            <el-select v-model="formPurchase.mold" placeholder="请选择模具编号">
                                <el-option label="模具一" value="模具一"></el-option>
                                <el-option label="模具二" value="模具二"></el-option>
                                <el-option label="模具三" value="模具三"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="花色" prop="color">
                            <el-select v-model="formPurchase.color" placeholder="请选择花色">
                                <el-option label="花色1" value="花色1"></el-option>
                                <el-option label="花色2" value="模具2"></el-option>
                                <el-option label="花色3" value="花色3"></el-option>
                            </el-select>

                        </el-form-item>
                    </el-col>



                </el-row>

                <el-row>
                    <el-col :span="24">
                        <!-- 独立标题 -->
                        <div class="divider-header">
                            <span class="divider-text">夹花任务信息</span>
                        </div>
                        <!-- 分割线 -->
                        <el-divider class="custom-divider"></el-divider>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="16">
                        <el-form-item label="夹花人员工号" prop="workerNo1">
                            <el-input v-model="formPurchase.workerNo1" placeholder="请输入夹花人员工号"></el-input>
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="夹花人员名称" prop="name1">
                            <el-input v-model="formPurchase.name1" placeholder="请输入夹花人员名称"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>



                <el-row>
                    <el-col :span="8">
                        <el-form-item label="夹花单价" prop="unitPrice1">
                            <el-input v-model="formPurchase.unitPrice1" placeholder="请输入夹花单价"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="夹花次品数量" prop="rejectNumber1">
                            <el-input v-model="formPurchase.rejectNumber1" placeholder="请输入夹花次品数量"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="夹花完成数量" prop="completedNumber1">
                            <el-input v-model="formPurchase.completedNumber1" placeholder="请输入夹花完成数量"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="夹花完成时间" prop="completionTime1">
                            <el-date-picker style="width: 150px;" width="200px" type="date" placeholder="请选择夹花完成时间"
                                v-model="formPurchase.completionTime1" />
                        </el-form-item>
                        <!-- <el-form-item label="夹花完成时间" prop="completionTime1">
                            <el-input v-model="formPurchase.completionTime1" placeholder="请输入夹花完成时间"></el-input>
                        </el-form-item> -->
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <!-- 独立标题 -->
                        <div class="divider-header">
                            <span class="divider-text">刷花任务信息</span>
                        </div>
                        <!-- 分割线 -->
                        <el-divider class="custom-divider"></el-divider>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="16">
                        <el-form-item label="刷花人员工号" prop="workerNo2">
                            <el-input v-model="formPurchase.workerNo2" placeholder="请输入刷花人员工号"></el-input>
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="刷花人员名称" prop="name2">
                            <el-input v-model="formPurchase.name2" placeholder="请输入刷花人员名称"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="刷花单价" prop="unitPrice2">
                            <el-input v-model="formPurchase.unitPrice2" placeholder="请输入刷花单价"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="刷花次品数量" prop="rejectNumber2">
                            <el-input v-model="formPurchase.rejectNumber2" placeholder="请输入刷花次品数量"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="刷花完成数量" prop="completedNumber2">
                            <el-input v-model="formPurchase.completedNumber2" placeholder="请输入刷花完成数量"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="刷花完成时间" prop="completionTime2">

                            <el-date-picker style="width: 150px;" width="200px" type="date" placeholder="请选择刷花完成时间"
                                v-model="formPurchase.completionTime2" />
                        </el-form-item>
                        <!-- <el-input v-model="formPurchase.completionTime2" placeholder="请输入刷花完成时间"></el-input> -->

                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <!-- 独立标题 -->
                        <div class="divider-header">
                            <span class="divider-text">订花任务信息</span>
                        </div>
                        <!-- 分割线 -->
                        <el-divider class="custom-divider"></el-divider>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="16">
                        <el-form-item label="订花人员工号" prop="workerNo3">
                            <el-input v-model="formPurchase.workerNo3" placeholder="请输入订花人员工号"></el-input>
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="订花人员名称" prop="name3">
                            <el-input v-model="formPurchase.name3" placeholder="请输入订花人员名称"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="订花单价" prop="unitPrice3">
                            <el-input v-model="formPurchase.color" placeholder="请输入订花单价"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="订花次品数量" prop="rejectNumber3">
                            <el-input v-model="formPurchase.rejectNumber3" placeholder="请输入订花次品数量"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="订花完成数量" prop="completedNumber3">
                            <el-input v-model="formPurchase.completedNumber3" placeholder="请输入订花完成数量"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="订花完成时间" prop="completionTime3">
                            <el-date-picker style="width: 150px;" width="200px" type="date" placeholder="请选择订花完成时间"
                                v-model="formPurchase.completionTime3" />
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <!-- 独立标题 -->
                        <div class="divider-header">
                            <span class="divider-text">冲花任务信息</span>
                        </div>
                        <!-- 分割线 -->
                        <el-divider class="custom-divider"></el-divider>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="16">
                        <el-form-item label="冲花人员工号" prop="workerNo4">
                            <el-input v-model="formPurchase.workerNo4" placeholder="请输入冲花人员工号"></el-input>
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="冲花人员名称" prop="name4">
                            <el-input v-model="formPurchase.name4" placeholder="请输入冲花人员名称"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="冲花单价" prop="unitPrice4">
                            <el-input v-model="formPurchase.unitPrice4" placeholder="请输入冲花单价"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="冲花次品数量" prop="rejectNumber4">
                            <el-input v-model="formPurchase.rejectNumber4" placeholder="请输入冲花次品数量"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="冲花完成数量" prop="completedNumber4">
                            <el-input v-model="formPurchase.completedNumber4" placeholder="请输入冲花完成数量"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="冲花完成时间" prop="completionTime4">
                            <el-date-picker style="width: 150px;" width="200px" type="date" placeholder="请选择冲花完成时间"
                                v-model="formPurchase.completionTime4" />
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <!-- 独立标题 -->
                        <div class="divider-header">
                            <span class="divider-text">贴花任务信息</span>
                        </div>
                        <!-- 分割线 -->
                        <el-divider class="custom-divider"></el-divider>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="16">
                        <el-form-item label="贴花人员工号" prop="workerNo5">
                            <el-input v-model="formPurchase.workerNo5" placeholder="请输入贴花人员工号"></el-input>
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="贴花人员名称" prop="name5">
                            <el-input v-model="formPurchase.name5" placeholder="请输入贴花人员名称"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="贴花单价" prop="unitPrice5">
                            <el-input v-model="formPurchase.unitPrice5" placeholder="请输入贴花单价"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="贴花次品数量" prop="rejectNumber5">
                            <el-input v-model="formPurchase.rejectNumber5" placeholder="请输入贴花次品数量"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="贴花完成数量" prop="completedNumber5">
                            <el-input v-model="formPurchase.completedNumber5" placeholder="请输入贴花完成数量"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="贴花完成时间" prop="completionTime5">
                            <el-date-picker style="width: 150px;" width="200px" type="date" placeholder="请选择贴花完成时间"
                                v-model="formPurchase.completionTime5" />
                        </el-form-item>
                    </el-col>
                </el-row>


            </el-form>

            <div slot="footer" class="dialog-footer">
                <el-button type="primary">提交</el-button>
                <el-button @click="cancelPurchase">取消</el-button>
            </div>

        </el-dialog>

        <!-- 成型记录 -->
        <el-dialog :title="titleProductionDate" :visible.sync="openProductionDate" width="800px" append-to-body>
            <el-form :model="formProductionDate" ref="formProductionDate" :rules="rulesProductionDate"
                label-width="80px">

                <!-- <el-divider><h3>物料描述</h3></el-divider> -->
                <!--标记点-->
                <!-- <el-row>
                    <el-col :span="8">
                        <el-form-item label="任务单号" prop="taskNo">
                            <el-input v-model="formProductionDate.taskNo" placeholder="请输入生产任务单号"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="合同号" prop="contractNo">
                            <el-input v-model="formProductionDate.contractNo" placeholder="请输入合同号"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="产品代号" prop="productCode">
                            <el-input v-model="formProductionDate.productCode" placeholder="请输入产品代号"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row> -->
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="合同号" prop="contractNo">
                            <el-select v-model="formProductionDate.contractNo" placeholder="请选择生产任务单号">
                                <el-option label="PD-HZ92-27-NIO-NI" value="PD-HZ92-27-NIO-NI"></el-option>
                                <el-option label="PD-HZ92-31-NIO-NI" value="PD-HZ92-31-NIO-NI"></el-option>
                                <el-option label="PD-HZ72-33-NIO-NI" value="PD-HZ72-33-NIO-NI"></el-option>
                            </el-select>
                            <!-- <el-input v-model="formPurchase.contractNo" placeholder="请输入合同号"></el-input> -->
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="产品代号" prop="productCode">
                            <!-- <el-input v-model="formPurchase.name" placeholder="请输入产品代号"></el-input> -->
                            <el-select v-model="formProductionDate.productCode" placeholder="请选择产品代号">
                                <el-option label="HZ998-No-9876" value="HZ998-No-9876"></el-option>
                                <el-option label="HZ998-No-1987" value="HZ998-No-1987"></el-option>
                                <el-option label="HZ998-No-1989" value="HZ998-No-1989"></el-option>
                            </el-select>
                            <!-- <el-input v-model="formPurchase.name" placeholder="请输入产品代号"></el-input> -->
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="产品名称" prop="productName">
                            <el-input v-model="formProductionDate.productName" placeholder="请输入产品名称"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="模具编号" prop="mold">
                            <!-- <el-input v-model="formPurchase.mold" placeholder="请输入模具编号"></el-input> -->
                            <el-select v-model="formProductionDate.mold" placeholder="请选择模具编号">
                                <el-option label="模具一" value="模具一"></el-option>
                                <el-option label="模具二" value="模具二"></el-option>
                                <el-option label="模具三" value="模具三"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="花色" prop="color">
                            <el-select v-model="formProductionDate.color" placeholder="请选择花色">
                                <el-option label="花色1" value="花色1"></el-option>
                                <el-option label="花色2" value="模具2"></el-option>
                                <el-option label="花色3" value="花色3"></el-option>
                            </el-select>

                        </el-form-item>
                    </el-col>

                </el-row>
                <el-row>
                    <el-col :span="24">
                        <!-- 独立标题 -->
                        <div class="divider-header">
                            <span class="divider-text">成型任务信息</span>
                        </div>
                        <!-- 分割线 -->
                        <el-divider class="custom-divider"></el-divider>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="工号" prop="workerNo">
                            <el-input v-model="formProductionDate.workerNo" placeholder="请输入工号"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="姓名" prop="name">
                            <el-input v-model="formProductionDate.name" placeholder="请输入姓名"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="班次" prop="classes">
                            <el-input v-model="formProductionDate.classes" placeholder="请输入班次"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="机台" prop="machine">
                            <el-input v-model="formProductionDate.machine" placeholder="请输入机台"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="单价" prop="unitPrice">
                            <el-input v-model="formProductionDate.unitPrice" placeholder="请输入单价"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="成品数量" prop="completedNumber">
                            <el-input v-model="formProductionDate.completedNumber" placeholder="请输入单价"></el-input>
                            <!-- <el-select v-model="formProductionDate.warehouse" placeholder="请选择仓库">
                                <el-option label="原料仓库" value="1"></el-option>
                                <el-option label="加工厂" value="2"></el-option>
                                <el-option label="成品仓库" value="3"></el-option>
                            </el-select> -->
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="次品数量" prop="rejectNumber">
                            <el-input v-model="formProductionDate.rejectNumber" placeholder="请输入次品数量"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="废品数量" prop="wasteNumber">
                            <el-input v-model="formProductionDate.wasteNumber" placeholder="请输入废品数量"></el-input>
                            <!-- <el-select v-model="formProductionDate.unit" placeholder="请选择单位">
                                <el-option label="件" value="1"></el-option>
                                <el-option label="张" value="2"></el-option>
                                <el-option label="立方米" value="3"></el-option>
                                <el-option label="吨" value="4"></el-option>
                                <el-option label="个" value="5"></el-option>
                                <el-option label="公斤" value="6"></el-option>
                            </el-select> -->
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="毛边数量" prop="flashNumber">
                            <el-input v-model="formProductionDate.flashNumber" placeholder="请输入毛边数量"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="敲缺数量" prop="strikeNumber">
                            <el-input v-model="formProductionDate.strikeNumber" placeholder="请输入敲缺数量"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="等级" prop="rank">
                            <el-input v-model="formProductionDate.rank" placeholder="请输入等级"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="质检员" prop="QT">
                            <el-input v-model="formProductionDate.QT" placeholder="请输入质检员姓名"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="完成时间" prop="completionTime">

                            <el-date-picker style="width: 150px;" width="200px" type="date" placeholder="请选择完成时间"
                                v-model="formProductionDate.completionTime" />
                        </el-form-item>
                        <!-- <el-input v-model="formProductionDate.completionTime" placeholder="请输入完成时间"></el-input> -->

                    </el-col>


                </el-row>


            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="submitformProductionDate">提交</el-button>
                <el-button @click="cancelProductionDate">取消</el-button>
            </div>
        </el-dialog>
        <!--研磨表单-->
        <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
            <el-form ref="form" :model="form" :rules="rules" label-width="100px">
                <el-row>
                    <el-row>
                        <el-col :span="8">
                            <el-form-item label="合同号" prop="contractNo">
                                <el-select v-model="form.contractNo" placeholder="请选择生产任务单号">
                                    <el-option label="PD-HZ92-27-NIO-NI" value="PD-HZ92-27-NIO-NI"></el-option>
                                    <el-option label="PD-HZ92-31-NIO-NI" value="PD-HZ92-31-NIO-NI"></el-option>
                                    <el-option label="PD-HZ72-33-NIO-NI" value="PD-HZ72-33-NIO-NI"></el-option>
                                </el-select>
                                <!-- <el-input v-model="formPurchase.contractNo" placeholder="请输入合同号"></el-input> -->
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="产品代号" prop="productCode">
                                <!-- <el-input v-model="formPurchase.name" placeholder="请输入产品代号"></el-input> -->
                                <el-select v-model="form.productCode" placeholder="请选择产品代号">
                                    <el-option label="HZ998-No-9876" value="HZ998-No-9876"></el-option>
                                    <el-option label="HZ998-No-1987" value="HZ998-No-1987"></el-option>
                                    <el-option label="HZ998-No-1989" value="HZ998-No-1989"></el-option>
                                </el-select>
                                <!-- <el-input v-model="formPurchase.name" placeholder="请输入产品代号"></el-input> -->
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="产品名称" prop="productName">
                                <el-input v-model="form.productName" placeholder="请输入产品名称" />
                            </el-form-item>
                        </el-col>

                    </el-row>

                    <el-row>
                        <el-col :span="8">
                            <el-form-item label="模具编号" prop="mold">
                                <!-- <el-input v-model="formPurchase.mold" placeholder="请输入模具编号"></el-input> -->
                                <el-select v-model="form.mold" placeholder="请选择模具编号">
                                    <el-option label="模具一" value="模具一"></el-option>
                                    <el-option label="模具二" value="模具二"></el-option>
                                    <el-option label="模具三" value="模具三"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="花色" prop="color">
                                <el-select v-model="form.color" placeholder="请选择模具编号">
                                    <el-option label="花色1" value="花色1"></el-option>
                                    <el-option label="花色2" value="模具2"></el-option>
                                    <el-option label="花色3" value="花色3"></el-option>
                                </el-select>

                            </el-form-item>
                        </el-col>

                    </el-row>

                    <el-row>
                        <el-col :span="24">
                            <!-- 独立标题 -->
                            <div class="divider-header">
                                <span class="divider-text">磨边任务信息</span>
                            </div>
                            <!-- 分割线 -->
                            <el-divider class="custom-divider"></el-divider>
                        </el-col>
                    </el-row>

                    <el-col :span="8">
                        <el-form-item label="磨边人员工号" prop="workerNo1">
                            <el-input v-model="form.workerNo1" placeholder="请输入磨边人员工号" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="磨边人员姓名" prop="name1">
                            <el-input v-model="form.name1" placeholder="请输入磨边人员姓名" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="磨边单价" prop="unitPrice1">
                            <el-input v-model="form.unitPrice1" placeholder="请输入磨边单价" />
                            <!-- <el-select v-model="form.type" placeholder="请选择客户类别">
                   <el-option label="代理部A区客户" value="代理部A区客户"></el-option>
                   <el-option label="代理部B区客户" value="代理部B区客户"></el-option>
                   <el-option label="英国代理客户" value="英国代理客户"></el-option>
                  <el-option label="日本代理客户" value="日本代理客户"></el-option>
               </el-select> -->
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="磨边次品数量" prop="rejectNumber1">
                            <el-input v-model="form.rejectNumber1" placeholder="请输入磨边次品数量" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="磨边完成数量" prop="completedNumber1">
                            <el-input v-model="form.completedNumber1" placeholder="请输入磨边完成数量" />
                            <!-- <el-select v-model="form.attribute" placeholder="请选择客户属性" style="width: 240px;" :disabled="isEdit">
                <el-option value="内销" label="内销" />
                <el-option value="外销" label="外销" />

              </el-select> -->
                            <!-- <el-input v-model="form.attribute" placeholder=" /> -->
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="磨边完成时间" prop="completionTime1">
                            <el-date-picker style="width: 150px;" width="200px" type="date" placeholder="请选择磨边完成时间"
                                v-model="form.completionTime1" />
                            <!-- <el-input v-model="form.completionTime1" placeholder="请输入客户地址" /> -->
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="24">
                        <!-- 独立标题 -->
                        <div class="divider-header">
                            <span class="divider-text">磨孔任务信息</span>
                        </div>
                        <!-- 分割线 -->
                        <el-divider class="custom-divider"></el-divider>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="磨孔人员工号" prop="workerNo2">
                            <el-input v-model="form.workerNo2" placeholder="请输入磨孔人员工号" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="磨孔人员姓名" prop="name2">
                            <el-input v-model="form.name2" placeholder="请输入磨孔人员姓名" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="磨孔单价" prop="unitPrice2">
                            <el-input v-model="form.unitPrice2" placeholder="请输入磨孔单价" />
                            <!-- <el-select v-model="form.是否需要货位" style="width: 240px;" :disabled="isEdit">
                <el-option value="是" label="是" />
                <el-option value="否" label="否" />
              </el-select> -->
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="磨孔次品数量" prop="rejectNumber2">
                            <el-input v-model="form.rejectNumber2" placeholder="请输入磨孔次品数量" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="磨孔完成数量" prop="completedNumber2">
                            <el-input v-model="form.completedNumber2" placeholder="请输入磨孔完成数量" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="磨孔完成时间" prop="completionTime2">
                            <el-date-picker style="width: 150px;" width="200px" type="date" placeholder="请选择磨孔完成时间"
                                v-model="form.completionTime2" />
                            <!-- <el-input v-model="form.bank" placeholder="请输入开户行" /> -->
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="24">
                        <!-- 独立标题 -->
                        <div class="divider-header">
                            <span class="divider-text">抛光任务信息</span>
                        </div>
                        <!-- 分割线 -->
                        <el-divider class="custom-divider"></el-divider>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="抛光人员工号" prop="workerNo3">
                            <el-input v-model="form.workerNo3" placeholder="请输入抛光人员工号" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="抛光人员姓名" prop="name3">
                            <el-input v-model="form.name3" placeholder="请输入抛光人员姓名" />
                            <!-- <el-select v-model="form.是否管制" style="width: 240px;" :disabled="isEdit">
                <el-option value="是" label="是" />
                <el-option value="否" label="否" />
              </el-select> -->
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="抛光单价" prop="unitPrice3">
                            <el-input v-model="form.unitPrice3" placeholder="请输入抛光单价" />
                            <!-- <el-select v-model="form.来源" style="width: 240px;" :disabled="isEdit">
                <el-option value="自制" label="自制" />
                <el-option value="购买" label="购买" />
              </el-select> -->
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="抛光次品数量" prop="rejectNumber3">
                            <el-input v-model="form.rejectNumber3" placeholder="请输入抛光次品数量" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="抛光完成数量" prop="completedNumber3">
                            <el-input v-model="form.completedNumber3" placeholder="请输入抛光完成数量 " />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="抛光完成时间" prop="completionTime3">
                            <el-date-picker style="width: 150px;" width="200px" type="date" placeholder="请选择抛光完成时间"
                                v-model="form.completionTime3" />
                            <!-- <el-input v-model="form.bank" placeholder="请输入开户行" /> -->

                            <!-- <el-input v-model="form.completionTime3" placeholder="请输入运输方式" /> -->
                        </el-form-item>
                    </el-col>
                    <el-row>
                        <el-col :span="24">
                            <!-- 独立标题 -->
                            <div class="divider-header">
                                <span class="divider-text">二级质检员信息</span>
                            </div>
                            <!-- 分割线 -->
                            <el-divider class="custom-divider"></el-divider>
                        </el-col>
                    </el-row>
                    <row>
                        <el-col :span="8">
                            <el-form-item label="二级质检员" prop="QTSecond">
                                <el-input v-model="form.QTSecond" placeholder="请输入二级质检员 " />
                            </el-form-item>
                        </el-col>
                    </row>
                </el-row>




            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="submitForm">确 定</el-button>
                <el-button @click="cancel">取 消</el-button>
            </div>
        </el-dialog>

        <el-dialog :title="titleComm" :visible.sync="openComm" width="1000px" append-to-body>
            <el-form ref="formComm" :model="formComm" label-width="80px">

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="合同号" prop="contractNo">
                            <el-select v-model="formComm.contractNo" placeholder="请选择生产任务单号">
                                <el-option label="PD-HZ92-27-NIO-NI" value="PD-HZ92-27-NIO-NI"></el-option>
                                <el-option label="PD-HZ92-31-NIO-NI" value="PD-HZ92-31-NIO-NI"></el-option>
                                <el-option label="PD-HZ72-33-NIO-NI" value="PD-HZ72-33-NIO-NI"></el-option>
                            </el-select>
                            <!-- <el-input v-model="formPurchase.contractNo" placeholder="请输入合同号"></el-input> -->
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="产品代号" prop="productCode">
                            <!-- <el-input v-model="formPurchase.name" placeholder="请输入产品代号"></el-input> -->
                            <el-select v-model="formComm.productCode" placeholder="请选择产品代号">
                                <el-option label="HZ998-No-9876" value="HZ998-No-9876"></el-option>
                                <el-option label="HZ998-No-1987" value="HZ998-No-1987"></el-option>
                                <el-option label="HZ998-No-1989" value="HZ998-No-1989"></el-option>
                            </el-select>
                            <!-- <el-input v-model="formPurchase.name" placeholder="请输入产品代号"></el-input> -->
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="产品名称" prop="productName">
                            <el-input v-model="formComm.productName" placeholder="请输入产品名称" />
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="模具编号" prop="mold">
                            <!-- <el-input v-model="formPurchase.mold" placeholder="请输入模具编号"></el-input> -->
                            <el-select v-model="formComm.mold" placeholder="请选择模具编号">
                                <el-option label="模具一" value="模具一"></el-option>
                                <el-option label="模具二" value="模具二"></el-option>
                                <el-option label="模具三" value="模具三"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">

                        <el-form-item label="花色" prop="color">
                            <el-select v-model="formComm.color" placeholder="请选择模具编号">
                                <el-option label="花色1" value="花色1"></el-option>
                                <el-option label="花色2" value="模具2"></el-option>
                                <el-option label="花色3" value="花色3"></el-option>
                            </el-select>


                        </el-form-item>
                    </el-col>

                </el-row>
                <el-row>
                    <el-col :span="24">
                        <!-- 独立标题 -->
                        <div class="divider-header">
                            <span class="divider-text">包装任务信息</span>
                        </div>
                        <!-- 分割线 -->
                        <el-divider class="custom-divider"></el-divider>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="工号" prop="workNo">
                            <el-input v-model="formComm.workNo" placeholder="请输入包装员工工号" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="姓名" prop="name">
                            <el-input v-model="formComm.name" placeholder="请输入包装员工姓名" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="单价" prop="unitPrice">
                            <el-input v-model="formComm.unitPrice" placeholder="请输入单价" />
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item label="完成数量" prop="completedNumber">
                            <el-input v-model="formComm.completedNumber" placeholder="请输入完成数量" />
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">

                        <el-form-item label="完成时间" prop="completionTime">
                            <el-date-picker style="width: 150px;" width="200px" type="date" placeholder="请选择包装完成时间"
                                v-model="formComm.completionTime" />
                        </el-form-item>
                    </el-col>

                </el-row>



            </el-form>
            <div slot="footer" class="dialog-footer">
                <div slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="submitFormComm">确定</el-button>
                    <el-button @click="cancelComm">取消</el-button>
                </div>
            </div>
        </el-dialog>
    </div>
</template>

<script>

export default {
    data() {
        return {
            // 花纸任务单
            titlePurchase: '',
            openPurchase: false,
            formPurchase: {},
            rulesPurchase: {},
            PurchaseDate: [{
                taskNo: 'PD-HZ92-27-NIO-NI',
                contractNo: 'NO-989-888',
                productCode: 'HZ998-No-9876',
                productName:'产品一',
                mold: '模具一',
                color: '花色1',
                workerNo1: 'GH-HZ-2910',
                name1: '花纸员工1',
                unitPrice1: '0.5',
                rejectNumber1: '15',
                completedNumber1: '3000',
                completionTime1: '2024-05-27',
                 workerNo2: 'GH-HZ-2370',
                name2: '花纸员工2',
                unitPrice2: '0.3',
                rejectNumber2: '11',
                completedNumber2: '5000',
                completionTime2: '2024-05-27',
                 workerNo3: 'GH-HZ-3317',
                name3: '花纸员工3',
                unitPrice3: '0.7',
                rejectNumber3: '8',
                completedNumber3: '2000',
                completionTime3: '2024-05-28',
                 workerNo4: 'GH-HZ-2910',
                name4: '花纸员工4',
                unitPrice4: '0.5',
                rejectNumber4: '15',
                completedNumber4: '3000',
                completionTime4: '2024-05-29',
                 workerNo5: 'GH-HZ-2980',
                name5: '花纸员工5',
                unitPrice5: '0.55',
                rejectNumber5: '20',
                completedNumber5: '4000',
                completionTime5: '2024-05-29',
                
            },{
                taskNo: 'PD-HZ92-31-NIO-NI',
                contractNo: 'NO-989-910',
                productCode: 'HZ998-No-1987',
                productName: '产品二',
                mold: '模具二',
                color: '花色2',
                workerNo1: 'GH-HZ-1970',
                name1: '花纸员工A',
                unitPrice1: '0.57',
                rejectNumber1: '25',
                completedNumber1: '3120',
                completionTime1: '2024-06-19',
                 workerNo2: 'GH-HZ-1376',
                name2: '花纸员工B',
                unitPrice2: '0.33',
                rejectNumber2: '17',
                completedNumber2: '5120',
                completionTime2: '2024-06-20',
                 workerNo3: 'GH-HZ-2327',
                name3: '花纸员工C',
                unitPrice3: '0.77',
                rejectNumber3: '11',
                completedNumber3: '2210',
                completionTime3: '2024-06-20',
                 workerNo4: 'GH-HZ-2937',
                name4: '花纸员工D',
                unitPrice4: '0.51',
                rejectNumber4: '19',
                completedNumber4: '3227',
                completionTime4: '2024-06-21',
                 workerNo5: 'GH-HZ-2189',
                name5: '花纸员工E',
                unitPrice5: '0.59',
                rejectNumber5: '23',
                completedNumber5: '4210',
                completionTime5: '2024-06-21',
                
            }],

            // 成型记录单
            titleProductionDate: '',
            openProductionDate: false,
            formProductionDate: {},
            rulesProductionDate: {},
            ProductionDate: [{
                taskNo: 'PD-CX728-31-NIO-NI',
                contractNo: 'NO-989-888',
                productCode: 'HZ998-No-9876',
                productName: '产品一',
                mold: '模具一',
                color: '花色1',
                 workerNo: "A001",
                 name: "王小明",
                 classes: "早班",
                machine: "CNC-01",
                unitPrice: 2.35,
                completedNumber: 1580,
                rejectNumber: 23,
                wasteNumber: 5,
                flashNumber: 12,
                strikeNumber: 8,
                rank: "A级",
                QT: "李质检",
               completionTime: "2023-05-30"
                
                
            },{
                taskNo: 'PD-CX992-31-NIO-NI',
                contractNo: 'NO-989-910',
                productCode: 'HZ998-No-1987',
                productName: '产品二',
                mold: '模具二',
                color: '花色2',
                workerNo: "B002",
                name: "张丽华",
                classes: "晚班",
                machine: "INJ-05",
               unitPrice: 1.85,
               completedNumber: 2345,
               rejectNumber: 45,
               wasteNumber: 8,
                flashNumber: 18,
                strikeNumber: 11,
                rank: "B级",
                QT: "王检查员",
                completionTime: "2023-06-22"

            }],
            commdate:[{
                taskNo: 'PD-CX728-31-NIO-NI',
                contractNo: 'NO-989-888',
                productCode: 'HZ998-No-9876',
                productName: '产品一',
                mold: '模具一',
                color: '花色1',
                "workNo": "bz3-92-4x1",  // 格式校验：包含bz且符合xxx-xx-xxx结构
                "name": "王建军",        // 随机中文姓名
                "completedNumber": 238,  // 合理区间：每日完成量100-500件
                "completionTime": "2024-06-02",  // 时间范围：近30天内
                "unitPrice": 0.75    

            }, {
                taskNo: 'PD-HZ92-31-NIO-NI',
                contractNo: 'NO-989-910',
                productCode: 'HZ998-No-1987',
                productName: '产品二',
                mold: '模具二',
                color: '花色2',
                "workNo": "5bz-a8-709",
                "name": "李秀兰",
                "completedNumber": 385,
                "completionTime": "2024-06-25",
                "unitPrice": 1.11

                }],

            // 半成品入库单
            titleHalfFinished: '',
            openHalfFinished: false,
            formHalfFinished: {},
            rulesHalfFinished: {},

            titleComm: '',
            openComm: false,
            formComm: {},
            

            // 加载动画
            loading: false,

            radio: 1,
            checked: 1,
            activeName: 'first',
            showCard: true,
            showSearch: true,
            queryParams: {
                date: ''
            },
            SaleReturn: [],
            Other: [],
            form: {
                staff: '',
                date: '',
                accountant: '',
                modifier: '',
                createDate: '',
                auditDate: '',
                auditor: '',
                auditInfo: '',
                auditLevel: ''
            },
            total: 0,
            title: null,
      // 总条数
      total: 0,
      // 打开弹出框
      open: false,
      // 表格
      form: {},
      // 校验
      rules: {},

      detailedData: [{
          
        "taskNo": "PD-YM92-35-NIO-NI",
        "contractNo": "NO-456-789",
        "productCode": "HZ998-No-5432",
          productName: '产品一',
        "mold": "模具三",
        "color": "花色3",
        "workerNo1": "GH-YM-9924",
        "name1": "研磨员工1",
        "unitPrice1": 0.45,
        "rejectNumber1": 12,
        "completedNumber1": 2800,
        "completionTime1": "2024-06-01",
        "workerNo2": "GH-YM-7752",
        "name2": "研磨员工2",
        "unitPrice2": 0.38,
        "rejectNumber2": 9,
        "completedNumber2": 4200,
        "completionTime2": "2024-06-02",
        "workerNo3": "GH-YM-9041",
        "name3": "研磨员工3",
        "unitPrice3": 0.65,
        "rejectNumber3": 6,
        "completedNumber3": 3500,
        "completionTime3": "2024-06-02",
        "workerNo4": "GH-YM-1267",
        "name4": "研磨员工4",
        "unitPrice4": 0.52,
        "rejectNumber4": 18,
        "completedNumber4": 4800,
        "completionTime4": "2024-06-02",
        "workerNo5": "GH-YM-5531",
        "name5": "花纸员工5",
        "unitPrice5": 0.72,
        "rejectNumber5": 7,
        "completedNumber5": 3900,
        "completionTime5": "2024-06-03",
        QTSecond:'二级质检员1'
    },
    {
        "taskNo": "PD-YM93-22-NIO-NI",
        "contractNo": "NO-112-334",
        "productCode": "HZ998-No-6677",
        "mold": "模具四",
        productName: '产品二',
        "color": "花色4",
        "workerNo1": "GH-YM-2398",
        "name1": "研磨员工A",
        "unitPrice1": 0.41,
        "rejectNumber1": 14,
        "completedNumber1": 3100,
        "completionTime1": "2024-06-23",
        "workerNo2": "GH-YM-8741",
        "name2": "花纸员工B",
        "unitPrice2": 0.29,
        "rejectNumber2": 22,
        "completedNumber2": 4500,
        "completionTime2": "2024-06-23",
        "workerNo3": "GH-YM-3562",
        "name3": "研磨员工C",
        "unitPrice3": 0.63,
        "rejectNumber3": 5,
        "completedNumber3": 2700,
        "completionTime3": "2024-06-24",
        "workerNo4": "GH-YM-9823",
        "name4": "研磨员工D",
        "unitPrice4": 0.57,
        "rejectNumber4": 16,
        "completedNumber4": 3600,
        "completionTime4": "2024-06-25",
        "workerNo5": "GH-HZ-4477",
        "name5": "研磨员工E",
        "unitPrice5": 0.68,
        "rejectNumber5": 10,
        "completedNumber5": 4100,
        "completionTime5": "2024-06-25",
         QTSecond:'二级质检员2'
    }],
        }
        
    },
    methods: {
          filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
    handleNodeClick(data) {
      if (data.label === '原材料') {
        this.tableData = this.tableData1[0].children;
        this.isShow1 = false;
        this.isShow2 = false;
        this.isShow3 = false;
        this.isShow4 = false;
        this.isShow5 = false;
        this.isShow6 = false;
      } else if (data.label === '辅料类') {
        this.tableData = this.tableData1[1].children;
        this.isShow1 = false;
        this.isShow2 = false;
        this.isShow3 = false;
        this.isShow4 = true;
        this.isShow5 = false;
        this.isShow6 = false;
      } else if (data.label === '半成品类') {
        this.tableData = this.tableData1[2].children;
        this.isShow1 = false;
        this.isShow2 = true;
        this.isShow3 = false;
        this.isShow4 = false;
        this.isShow5 = false;
        this.isShow6 = false;
     
      }
    },
    submitForm() {
      this.open = false;
    },
    cancel() { this.open = false; },
    handleQuery() {
      this.loading = false;
    },
    resetQuery() {
    },
    handleAdd() {
      this.title = '新增研磨生产记录'
      this.open = true;
      this.isEdit = false;
    },
    handleUpdate(row) {
      this.title = '编辑研磨生产记录'
      this.open = true;
      this.isEdit = false;
      this.form = row;
    },
      handleDeletePurchase(row) {
            this.$confirm('确认删除花纸生产记录吗？', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.PurchaseDate.splice(this.PurchaseDate.indexOf(row), 1);
                this.$message({
                    type: 'success',
                    message: '删除成功!'
                })
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消删除'
                })
            })
        },
handleDelete(row) {
    this.$confirm('确认删除研磨生产记录吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
    }).then(() => { // 用户点击确定时执行
        this.$message({
            type: 'success',
            message: '删除成功!'
        });
    }).catch(() => { // 用户点击取消时执行
        this.$message({
            type: 'info',
            message: '已取消删除'
        });
    });
},
    handleExport() { },
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.userId);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
  




        hand() {
            this.queryParams.rate = (this.queryParams.currency == 1) ? 1 : 7;
        },
        // 新增花纸生产记录
        handleAddPurchase() {
            this.resetPurchase();
            this.openPurchase = true;
            this.titlePurchase = '新增花纸生产记录';
        },
        // 修改花纸生产记录
        handleUpdatePurchase(row) {
            console.log(row)
            this.openPurchase = true;
            this.titlePurchase = '修改花纸生产记录';
            this.formPurchase = row;
        },
        // 删除花纸生产记录单
        handleDeletePurchase(row) {
            this.$confirm('确认删除花纸生产记录吗？', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.PurchaseDate.splice(this.PurchaseDate.indexOf(row), 1);
                this.$message({
                    type: 'success',
                    message: '删除成功!'
                })
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消删除'
                })
            })
        },
        // 取消花纸生产记录
        cancelPurchase() {
            this.resetPurchase();
            this.openPurchase = false;
        },
        // 提交花纸生产记录
        submitformPurchase() {
            this.$refs['formPurchase'].validate((valid) => {
                if (valid) {
                    this.loading = true;
                    if (this.titlePurchase == '新增花纸生产记录') {
                        setTimeout(() => {
                            this.loading = false;
                            this.PurchaseDate.push(this.formPurchase)
                            this.$message({
                                type: 'success',
                                message: '花纸生产记录添加成功!'
                            })
                        }, 1000)
                        console.log(this.PurchaseDate);

                        this.openPurchase = false;
                    } else if (this.titlePurchase == '修改花纸生产记录入库单') {
                        setTimeout(() => {
                            this.PurchaseDate.map((item, index) => {
                                if (item.code == this.formPurchase.code) {
                                    this.PurchaseDate[index] = this.formPurchase;
                                }
                            })
                            this.loading = false;
                            this.$message({
                                type: 'success',
                                message: '花纸生产记录修改成功!'
                            })
                        }, 1000);
                        this.openPurchase = false;
                    }
                }
            })
        },
         handleAdd1() {
            this.resetPurchase();
            this.openHalfFinished = true;
            this.titlePurchase = '新增研磨生产记录';
        },
        // 修改花纸生产记录
        handleUpdate1(row) {
            console.log(row)
            this.openHalfFinished = true;
            this.titlePurchase = '修改研磨生产记录';
            this.formPurchase = row;
        },
        // 删除花纸生产记录单
        handleDeletePurchase(row) {
            this.$confirm('确认删除花纸生产记录吗？', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.PurchaseDate.splice(this.PurchaseDate.indexOf(row), 1);
                this.$message({
                    type: 'success',
                    message: '删除成功!'
                })
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消删除'
                })
            })
        },
        // 取消花纸生产记录
        cancelPurchase() {
            this.resetPurchase();
            this.openPurchase = false;
        },
        cancelComm() {
            this.openComm = false;
        },
        // 提交花纸生产记录
        submitformPurchase() {
            this.$refs['formPurchase'].validate((valid) => {
                if (valid) {
                    this.loading = true;
                    if (this.titlePurchase == '新增花纸生产记录') {
                        setTimeout(() => {
                            this.loading = false;
                            this.PurchaseDate.push(this.formPurchase)
                            this.$message({
                                type: 'success',
                                message: '花纸生产记录添加成功!'
                            })
                        }, 1000)
                        console.log(this.PurchaseDate);

                        this.openPurchase = false;
                    } else if (this.titlePurchase == '修改花纸生产记录入库单') {
                        setTimeout(() => {
                            this.PurchaseDate.map((item, index) => {
                                if (item.code == this.formPurchase.code) {
                                    this.PurchaseDate[index] = this.formPurchase;
                                }
                            })
                            this.loading = false;
                            this.$message({
                                type: 'success',
                                message: '花纸生产记录修改成功!'
                            })
                        }, 1000);
                        this.openPurchase = false;
                    }
                }
            })
        },
        // 重置花纸生产记录
        resetPurchase() {
            this.formPurchase = {
            };
        },
        // 新增成型生产记录
        handleAddProduction() {
            this.resetProductionDate();
            this.openProductionDate = true;
            this.titleProductionDate = '新增成型生产记录';
        },
        // 修改成型生产记录
        handleUpdateProduction(row) {
            this.openProductionDate = true;
            this.titleProductionDate = '修改成型生产记录';
            this.formProductionDate = row;
        },
        // 删除生产退料单
        handleDeleteProduction(row) {
            this.$confirm('确认删除成型生产记录吗？', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.ProductionDate.splice(this.ProductionDate.indexOf(row), 1);
                this.$message({
                    type: 'success',
                    message: '删除成功!'
                })
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消删除'
                })
            })
        },
        handleAddComm() {
            this.titleComm = '添加包装生产记录';
            this.openComm = true;
        },
        handleUpdateComm(row) {
            this.openComm = true;
            this.titleComm = '修改包装生产记录';
            this.formComm = row;
        },
        handleDeleteComm(row) {
            this.$confirm('确定删除该包装生产记录？')
                .then(() => {
                    this.commdate.splice(this.commdate.indexOf(row), 1)
                    this.$message.success('删除成功!')
                }).catch(() => {
                    this.$message.error('取消删除!')
                })
        },
        // 订单明细提交
        submitFormComm() {
            this.$refs.formComm.validate((valid) => {
                if (valid) {
                    this.$message.success('提交成功!');
                    this.openComm = false;
                }
            })
        },
        // 订单明细取消
        cancelComm() {
            this.openComm = false;
        },

        // 提交生产退料单
        submitformProductionDate() {
            this.$refs['formProductionDate'].validate((valid) => {
                if (valid) {
                    this.loading = true;
                    if (this.titleProductionDate == '新增生产退料单') {
                        setTimeout(() => {
                            this.loading = false;
                            this.ProductionDate.push(this.formProductionDate)
                            this.$message({
                                type: 'success',
                                message: '生产退料单添加成功!'
                            })
                        }, 1000)
                        this.openProductionDate = false;
                    } else if (this.titleProductionDate == '修改生产退料单') {
                        setTimeout(() => {
                            this.ProductionDate.map((item, index) => {
                                if (item.code == this.formProductionDate.code) {
                                    this.ProductionDate[index] = this.formProductionDate;
                                }
                            })
                            this.loading = false;
                            this.$message({
                                type: 'success',
                                message: '生产退料单修改成功!'
                            })
                        }, 1000);
                        this.openProductionDate = false;
                    }

                }
            })
        },
        // 取消生产退料单
        cancelProductionDate() {
            this.openProductionDate = false;
            this.resetProductionDate();
        },
        // 重置生产退料单
        resetProductionDate() {
            this.formProductionDate = {
            };
        },
         handleQuery() {
            this.loading = false;
        },
        beforeExcelUpload(file) {
            const isExcel = [
                'application/vnd.ms-excel',
                'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
            ].includes(file.type);

            const isSizeValid = file.size / 1024 / 1024 <= 1; // 1MB限制

            if (!isExcel) {
                this.$message.error("只能上传Excel文件！");
                return false;
            }
            if (!isSizeValid) {
                this.$message.error("文件大小不能超过1MB！");
                return false;
            }
            return true; // 通过校验
        },

        // 文件选择处理
        handleFileChange(file) {
            if (file.raw) {
                if (this.beforeExcelUpload(file.raw)) {
                    this.readExcelFile(file.raw); // 实际处理文件的方法
                }
            }
        },

        // 读取Excel文件（需要安装xlsx库）
        readExcelFile(file) {
            const reader = new FileReader();
            reader.onload = (e) => {
                const data = new Uint8Array(e.target.result);
                const workbook = XLSX.read(data, { type: 'array' });
                // 这里处理workbook数据...
                console.log(workbook);
            };
            reader.readAsArrayBuffer(file);
        }
    }

}
</script>

<style scoped>
/* 标题容器 */
.divider-header {
    text-align: center;
    margin-bottom: -8px;
    /* 调整标题与分割线的间距 */
}

/* 标题样式 */
.divider-text {
    display: inline-block;
    font-size: 16px;
    color: #666;
    background: transparent;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* 分割线样式 */
::v-deep .custom-divider.el-divider--horizontal {
    margin: 12px 0;
    /* 控制分割线上下间距 */
    border-top: 2px dashed #ddd;
    background: transparent;
}

/* 移除默认内容区域 */
::v-deep .custom-divider .el-divider__text {
    display: none;
}
</style>
